//
//  Algorithm.hpp
//  newAR
//
//  Created by fg on 5/9/16.
//  Copyright © 2016 Shangjin Zhai. All rights reserved.
//

#ifndef Algorithm_hpp
#define Algorithm_hpp

#include <stdio.h>
#include <opencv2/opencv.hpp>
#include "Feature.hpp"
#include "Basic Structure.h"

using markerAR::Feature;
using Eigen::Vector2d;

namespace misc{
    
    int distance(const cv::Mat &a,const cv::Mat &b);
    double computeMeanReprojectEror(const IntrinsicMatrix &K,const Pose&p,const std::vector<Feature*>&fts);

    void matchRadius(const std::vector<Feature*>&fts1,const std::vector<Feature*>&fts2,std::vector<cv::DMatch>&dmatches,cv::Size fullImgSize);
    int
    wn_PnPoly( Vector2d P, Vector2d* V, int n );
    void warpMask(cv::Mat &mask,cv::Size imgSize,const Eigen::Matrix3d &H);
}

#endif /* Algorithm_hpp */
